﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DFGK_WMS.Context.Migrations
{
    public partial class 报废报损工单表维修工单表 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            //migrationBuilder.CreateTable(
            //    name: "T_EquipmentCollection",
            //    columns: table => new
            //    {
            //        Id = table.Column<long>(type: "bigint", nullable: false),
            //        Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //        EquipmentType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //        CollectionDate = table.Column<DateTime>(type: "datetime2", nullable: true),
            //        CollectionUser = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //        ReturnDate = table.Column<DateTime>(type: "datetime2", nullable: true),
            //        CreateUserId = table.Column<long>(type: "bigint", nullable: false),
            //        CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
            //        CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
            //        ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
            //        ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
            //        ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
            //        IsDel = table.Column<bool>(type: "bit", nullable: false)
            //    },
            //    constraints: table =>
            //    {
            //        table.PrimaryKey("PK_T_EquipmentCollection", x => x.Id);
            //    });

            migrationBuilder.CreateTable(
                name: "T_MaintenanceOrder",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    TechnicianName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    StartTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    EndTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    EquipmentName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    RepairDescription = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    RepairSuccess = table.Column<bool>(type: "bit", nullable: false),
                    RepairCost = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_MaintenanceOrder", x => x.Id);
                });

            //migrationBuilder.CreateTable(
            //    name: "T_RepairApplication",
            //    columns: table => new
            //    {
            //        Id = table.Column<long>(type: "bigint", nullable: false),
            //        Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //        RepairContent = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //        RepairTime = table.Column<DateTime>(type: "datetime2", nullable: true),
            //        RepairUser = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
            //        ApprovalSequence = table.Column<int>(type: "int", nullable: false),
            //        ApprovalProcess = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //        ApprovalProcessRemark = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //        ApprovalNode = table.Column<string>(type: "nvarchar(max)", nullable: true),
            //        ApprovalStatus = table.Column<int>(type: "int", nullable: false),
            //        CreateUserId = table.Column<long>(type: "bigint", nullable: false),
            //        CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
            //        CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
            //        ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
            //        ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
            //        ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
            //        IsDel = table.Column<bool>(type: "bit", nullable: false)
            //    },
            //    constraints: table =>
            //    {
            //        table.PrimaryKey("PK_T_RepairApplication", x => x.Id);
            //    });

            migrationBuilder.CreateTable(
                name: "T_ScrapLossOrder",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false),
                    OperatorName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    EquipmentName = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ScrapLossType = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    ScrapLossAmount = table.Column<int>(type: "int", nullable: false),
                    ScrapLossValue = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    ScrapLossDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Department = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
                    Approved = table.Column<bool>(type: "bit", nullable: false),
                    CreateUserId = table.Column<long>(type: "bigint", nullable: false),
                    CreateUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    ModifyUserId = table.Column<long>(type: "bigint", nullable: false),
                    ModifyUserName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
                    ModifyDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_ScrapLossOrder", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "T_EquipmentCollection");

            migrationBuilder.DropTable(
                name: "T_MaintenanceOrder");

            migrationBuilder.DropTable(
                name: "T_RepairApplication");

            migrationBuilder.DropTable(
                name: "T_ScrapLossOrder");
        }
    }
}
